package org.webdb.webapp.handlers;

import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;

import org.jboss.resteasy.spi.BadRequestException;

@Provider
public class RestEasyBadRequestHandler implements
        ExceptionMapper<BadRequestException> {

    private ExceptionMapper<Throwable> delegate;

    public RestEasyBadRequestHandler(ExceptionMapper<Throwable> delegate) {
        this.delegate = delegate;
    }

    @Override
    public Response toResponse(BadRequestException exception) {
        return delegate.toResponse(exception);
    }

}
